package com.tbit.uqbike.object.pojo;


import com.tbit.uqbike.annos.Excel;
import com.tbit.uqbike.webmanager.util.StringUtils;
import lombok.Data;

import java.util.Date;

/**
 * @Author HZW
 * @ClassName parkPointBound
 * @Description 站点绑定实体类
 * @date 2021/12/16 9:59
 * @Version 1.0
 */
@Data
public class ParkPointBound {
    /**
     * 绑定id
     */
    private Integer boundId;
    /**
     * 站点id
     */
    private Integer parkPointId;
    /**
     * 站点名称
     */
    @Excel(name = "站点名称", sort = 3)
    private String parkPointName;
    /**
     * 状态
     */
    private Integer state;
    /**
     * 设备编号
     */
    @Excel(name = "设备编号", sort = 2)
    private String machineNo;
    private String functionNo;
    /**
     * 类型 1 rfid
     */
    @Excel(name = "设备类型", sort = 1, readConverterExp = "0=道钉,1=RFID")
    private Integer type;
    /**
     * 添加时间
     */
    @Excel(name = "异常上报时间", sort = 6)
    private String addTime;
    /**
     * 更新时间
     */
    @Excel(name = "最近上报时间", sort = 4)
    private String updateTime;
    /**
     * 备注信息
     */
    private String remark;
    /**
     * 总数
     */
    private Integer total;

    /**
     * 区域id
     */
    private Integer accountId;
    /**
     * 异常上报人id
     */
    private Integer userMainId;
    /**
     * 异常上报人姓名
     */
    @Excel(name = "异常上报人", sort = 5)
    private String userMainName;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 结束时间
     */
    private Date endTime;

    public ParkPointBound() {
    }

    public ParkPointBound(Integer accountId) {
        this.accountId = accountId;
    }

    public ParkPointBound(String addTime, Integer accountId) {
        this.addTime = addTime;
        this.accountId = accountId;
    }

    public void dateFormat() {
        if (StringUtils.isNotEmpty(addTime)) {
            addTime = addTime.substring(0, addTime.lastIndexOf("."));
        }
        if (StringUtils.isNotEmpty(updateTime)) {
            updateTime = updateTime.substring(0, updateTime.lastIndexOf("."));
        }
    }
}
